package cn.darkhorse.pick.service.impl;

import java.util.List;

import cn.darkhorse.pick.pojo.PickSubscribe;
import cn.darkhorse.pick.mapper.PickSubscribeMapper;
import cn.darkhorse.pick.service.IPickSubscribeService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 采棉机预约Service业务层处理
 *
 * @author ruoyi
 * @date 2021-05-06
 */
@Service
public class PickSubscribeServiceImpl implements IPickSubscribeService
{
    @Autowired
    private PickSubscribeMapper pickSubscribeMapper;

    /**
     * 查询采棉机预约
     *
     * @param subscribeId 采棉机预约ID
     * @return 采棉机预约
     */
    @Override
    public PickSubscribe selectPickSubscribeById(Long subscribeId)
    {
        return pickSubscribeMapper.selectPickSubscribeById(subscribeId);
    }

    /**
     * 查询采棉机预约列表
     *
     * @param pickSubscribe 采棉机预约
     * @return 采棉机预约
     */
    @Override
    public List<PickSubscribe> selectPickSubscribeList(PickSubscribe pickSubscribe)
    {
        return pickSubscribeMapper.selectPickSubscribeList(pickSubscribe);
    }

    /**
     * 新增采棉机预约
     *
     * @param pickSubscribe 采棉机预约
     * @return 结果
     */
    @Override
    public int insertPickSubscribe(PickSubscribe pickSubscribe)
    {
        pickSubscribe.setCreateTime(DateUtils.getNowDate());
        return pickSubscribeMapper.insertPickSubscribe(pickSubscribe);
    }

    /**
     * 修改采棉机预约
     *
     * @param pickSubscribe 采棉机预约
     * @return 结果
     */
    @Override
    public int updatePickSubscribe(PickSubscribe pickSubscribe)
    {
        pickSubscribe.setUpdateTime(DateUtils.getNowDate());
        return pickSubscribeMapper.updatePickSubscribe(pickSubscribe);
    }

    /**
     * 删除采棉机预约对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePickSubscribeByIds(String ids)
    {
        return pickSubscribeMapper.deletePickSubscribeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除采棉机预约信息
     *
     * @param subscribeId 采棉机预约ID
     * @return 结果
     */
    @Override
    public int deletePickSubscribeById(Long subscribeId)
    {
        return pickSubscribeMapper.deletePickSubscribeById(subscribeId);
    }
}
